home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / debugger / xxgdb-1.000 < prev    next >
Encoding:
Text File  |  1996-11-16  |  4.3 KB  |  189 lines

  1.  
  2. This is a patch to my port of xxgdb 1.08 to Linux.
  3.  
  4. This patch allows you to build xxgdb under X11R6.
  5. (The X11R6 header files do not work on Linux when SYSV is defined, so this
  6. patch make xxgdb not define SYSV for Linux.)
  7.  
  8. Have a nice day.
  9. -Sal Valente <svalente@mit.edu>
  10.  
  11. diff -ur xxgdb-old/Imakefile xxgdb/Imakefile
  12. --- xxgdb-old/Imakefile    Sat Dec 17 04:11:21 1994
  13. +++ xxgdb/Imakefile    Sat Dec  9 00:07:56 1995
  14. @@ -51,7 +51,7 @@
  15.  #endif
  16.  
  17.  #ifdef LinuxArchitecture
  18. -DEFINES = -DSYSV $(DEFGDB)
  19. +DEFINES = -DPOSIX $(DEFGDB)
  20.  #endif
  21.  
  22.  mallocc = #malloc.c
  23. diff -ur xxgdb-old/command.c xxgdb/command.c
  24. --- xxgdb-old/command.c    Mon Jan 10 15:36:59 1994
  25. +++ xxgdb/command.c    Sat Dec  9 00:09:26 1995
  26. @@ -383,24 +383,20 @@
  27.      XtPointer client_data;
  28.      XtPointer call_data;
  29.  {
  30. -#ifdef SYSV 
  31. +#ifdef POSIX
  32.      int status;
  33.  #else
  34.      union wait status;
  35. -#endif /* SYSV */
  36. +#endif
  37.  
  38.      write_dbx("quit\n");
  39.      XtDestroyApplicationContext(app_context);
  40.      kill(dbxpid, SIGKILL);
  41. -#ifdef SYSV
  42. -#if 1 /* instead of ifdef SVR4 */
  43. +#ifdef POSIX
  44.      status = waitpid(dbxpid, (int *)0, WNOHANG);    /* (MJH) */
  45.  #else
  46. -    waitpid(&status, NULL, WNOHANG);
  47. -#endif    /* SVR4 */
  48. -#else    /* not SYSV */
  49.      wait3(&status, WNOHANG, NULL);
  50. -#endif /* SYSV */
  51. +#endif
  52.      exit(0);
  53.  }
  54.  
  55. @@ -888,7 +884,7 @@
  56.                        parent, args, n);
  57.      CreateButtons(commandWindow);
  58.  #ifndef GDB /* (PW)12MAR93 : for gdb, use pwd command of gdb */
  59. -#ifndef SYSV 
  60. +#ifndef POSIX
  61.      getwd(cwd);
  62.  #endif
  63.  #endif /* not GDB */
  64. diff -ur xxgdb-old/dialog.c xxgdb/dialog.c
  65. --- xxgdb-old/dialog.c    Mon Nov 29 21:15:48 1993
  66. +++ xxgdb/dialog.c    Sat Dec  9 00:09:54 1995
  67. @@ -235,11 +235,11 @@
  68.  {
  69.  #ifndef GDB
  70.      FalseSignal = TRUE;
  71. -#ifdef SYSV /* (PW)13AUG92:  change SVR4 into SYSV */ /* (MJH) */
  72. +#ifdef POSIX
  73.     kill(-(dbxpid), SIGINT);
  74.  #else
  75.     killpg(dbxpid, SIGINT);
  76. -#endif /* SYSV */
  77. +#endif
  78.  #else      
  79.      write_dbx("\003");    /* (PW)18FEB91 : seems to work better */
  80.  #endif    /* GDB */
  81. @@ -282,7 +282,7 @@
  82.  {
  83.      FalseSignal = TRUE;
  84.  
  85. -#ifdef SYSV /* (PW)13AUG92:  change SVR4 into SYSV */ /* (MJH) */
  86. +#ifdef POSIX
  87.      kill(-(dbxpid), SIGQUIT);
  88.  #else
  89.      killpg(dbxpid, SIGQUIT);
  90. diff -ur xxgdb-old/filemenu.c xxgdb/filemenu.c
  91. --- xxgdb-old/filemenu.c    Thu Aug 25 23:46:39 1994
  92. +++ xxgdb/filemenu.c    Sat Dec  9 00:10:27 1995
  93. @@ -81,7 +81,7 @@
  94.  #include <X11/Xos.h>
  95.  #include <sys/stat.h>
  96.  
  97. -#ifdef SYSV 
  98. +#ifdef POSIX
  99.  #include <stdio.h>
  100.  #include <sys/param.h>
  101.  #include <sys/types.h>
  102. @@ -94,7 +94,7 @@
  103.  #define    S_IEXEC    00100        /* execute/search permission, owner */
  104.  #endif
  105.  #endif    /* _POSIX_SOURCE */
  106. -#endif    /* SYSV */
  107. +#endif
  108.  
  109.  #ifdef SUNOS4
  110.  #include <dirent.h>
  111. diff -ur xxgdb-old/signals.c xxgdb/signals.c
  112. --- xxgdb-old/signals.c    Sun Aug 14 04:10:27 1994
  113. +++ xxgdb/signals.c    Sat Dec  9 00:13:54 1995
  114. @@ -79,20 +79,20 @@
  115.  static void quit_handler()
  116.  {
  117.      int pid;
  118. -#ifdef SYSV 
  119. +#ifdef POSIX
  120.      int status;
  121.  #else
  122.      union wait status;
  123. -#endif /* SYSV */
  124. +#endif
  125.  
  126.      /*  wait for the child to report its status; if the child has died, 
  127.       *  exit gracefully.
  128.       */
  129. -#ifdef SYSV 
  130. +#ifdef POSIX
  131.      pid = waitpid((pid_t)-1, &status, WNOHANG|WUNTRACED);    /* (MJH) */
  132.  #else
  133.     pid =  wait3(&status, WNOHANG|WUNTRACED, NULL);
  134. -#endif /* SYSV */
  135. +#endif
  136.  
  137.  #ifdef EDIT_BUTTON
  138.      /* dont die if sub edit process dies */
  139. @@ -147,7 +147,7 @@
  140.      signal(SIGCHLD, quit_handler);    /* child status has changed */
  141.  }
  142.  
  143. -#ifdef SYSV
  144. +#ifdef POSIX
  145.  
  146.  typedef void (*signal_proc_t)();
  147.  
  148. @@ -160,7 +160,10 @@
  149.      act.sa_handler = proc;
  150.      sigemptyset (&act.sa_mask);
  151.      act.sa_flags = 0;
  152. +#ifdef SA_RESTART
  153. +    act.sa_flags |= SA_RESTART;
  154. +#endif
  155.      return (sigaction (sig, &act, &oact) < 0 ? SIG_ERR : oact.sa_handler);
  156.  }
  157.  
  158. -#endif /* SYSV */
  159. +#endif
  160. diff -ur xxgdb-old/xdbx.c xxgdb/xdbx.c
  161. --- xxgdb-old/xdbx.c    Sat Dec 17 04:12:07 1994
  162. +++ xxgdb/xdbx.c    Sat Dec  9 00:16:52 1995
  163. @@ -74,12 +74,11 @@
  164.  #define XGDBVERSION    "1.08"
  165.  #endif
  166.  
  167. -#ifdef SYSV 
  168. -#   include <stdio.h>
  169. -#   include <stdlib.h>
  170. -#   include <sys/param.h>
  171. +#include <stdio.h>
  172. +#ifdef POSIX
  173. +#include <stdlib.h>
  174.  #endif
  175. -
  176. +#include <sys/param.h>
  177.  #include "global.h"
  178.  #include "bitmaps.h"
  179.  #include "patchlevel.h"
  180. @@ -476,7 +475,7 @@
  181.      progname = argv[0];            /* (MJH) */
  182.          
  183.  #ifndef GDB /* (PW)12MAR93 : for gdb, use pwd command of gdb */
  184. -#ifdef SYSV 
  185. +#ifdef POSIX
  186.      getcwd((char *)cwd, MAXPATHLEN);
  187.  #endif
  188.  #endif /* not GDB */
  189.